/* Import font */
/* Google Fonts – load upright and italic for both */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,200..700;1,200..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap');

/* Reset and base styles */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video {
  margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }

/* CSS Variables */
html {
  font-size: 16px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  --easeInExpo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
  --easeOutExpo: cubic-bezier(0.19, 1, 0.22, 1);
  --easeInOutExpo: cubic-bezier(1, 0, 0, 1);
  --headerHeight: 4rem;
  --siteMaxWidth: 1200px;
  --accent-color: #a491fc;
  --grid-gap: 1.5rem;
}

@media only screen and (max-width: 768px) {
  html { font-size: 20px; }
}

/* Base body styles */
body {
  font-size: 1.2rem;
  color: #000;
  --background: #fff;
  background-color: #fff;
  font-family: "Inter", Helvetica, sans-serif;
  font-weight: 200;
  line-height: 1.5;
  transition: background 400ms cubic-bezier(0.19, 1, 0.22, 1), color 400ms cubic-bezier(0.19, 1, 0.22, 1);
}

/* Links */
a { text-decoration: none; color: inherit; }

/* 6-Column Grid System (namespaced) */
.site-container {
  max-width: var(--siteMaxWidth);
  margin-left: auto; margin-right: auto;
  padding-left: 2rem; padding-right: 2rem;
}
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--grid-gap); margin-bottom: 4rem; }
.grid-3 { grid-column: span 3; }
.grid-6 { grid-column: span 6; }
.grid-2 { grid-column: span 2; }
.grid-4 { grid-column: span 4; }
.grid-1 { grid-column: span 1; }

@media only screen and (max-width: 768px) {
  .grid { grid-template-columns: 1fr; gap: 1rem; }
  .grid-3, .grid-6, .grid-2, .grid-1 { grid-column: span 1; }
  .site-container { padding-left: 1rem; padding-right: 1rem; }
}

/* Typography */
h1, h2, h3, h4, h5, h6, p, ol, ul, pre, blockquote { margin-bottom: 1.2272727273rem; }
li p { margin-bottom: .8181818182rem; }
@media only screen and (min-width: 721px) {
  h1, h2 { text-rendering: optimizeLegibility; font-size: 1.3636363636rem; line-height: 1.1666666667; }
}

/* Horizontal rule */
hr { border: 0; height: 1px; background-color: var(--accent-color); margin-top: 2.4545454545rem; margin-bottom: 2.4545454545rem; }

/* Header */
.header {
  position: fixed; top: 0; left: 0; width: 100%;
  background-color: var(--background);
  z-index: 999; height: var(--headerHeight);
  border-bottom: 1px solid #eee;
}
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.header__logo { font-weight: 300; font-size: 1.2rem; color: #000; font-family: "Newsreader", Helvetica, sans-serif; font-style: italic;}
.header__logo img { display: none; }
.header__nav { display: flex; align-items: center; gap: 2rem; }
.header__items { display: flex; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; font-family: "Newsreader", Helvetica, sans-serif; font-style: italic;}
.header__item { display: inline-block; }
.header__item--toggle { display: none; }
.header__link { color: #000; text-decoration: none; font-weight: 300; transition: color 150ms;   font-family: "Newsreader", Helvetica, sans-serif; font-style: italic;}
.header__link:hover { color: var(--accent-color); }

@media only screen and (max-width: 768px) {
  .header__item:not(.header__item--toggle) { display: none; }
  .header__item--toggle { display: block; }
}

/* Modal toggle */
.modal-toggle { cursor: pointer; padding: .5rem; position: relative; right: -.5rem; top: -1px; }
.hamburger span { display: block; width: 20px; height: 2px; background-color: currentColor; margin: 4px 0; transition: 0.3s; }

/* Site Modal (namespaced to avoid Bootstrap .modal) */
.site-modal {
  position: relative; 
  visibility: hidden; 
  top: -999em; 
  left: -999em;
  height: 0; 
  width: 0; 
  opacity: 0;
  background-color: var(--background);
}
@media only screen and (max-width: 768px) {
  .is-modal-open .site-modal {
    z-index: 888; 
    position: fixed; 
    visibility: visible; 
    top: 0; 
    left: 0;
    height: 100%; 
    width: 100%; 
    opacity: 1; 
    overflow: auto;
  }
}
.site-modal .site-container {
  display: flex; flex-direction: column; flex-wrap: wrap;
  min-height: calc(100% - var(--headerHeight)); margin-top: var(--headerHeight);
}
.site-modal__items { display: flex; flex-direction: column; padding: 2rem 0; }
.site-modal__item { margin-bottom: 1rem; }
.site-modal__link { font-size: 1.2rem; color: #000; transition: color 150ms; }
.site-modal__link:hover { color: var(--accent-color); }

/* Main content */
.main { padding-top: var(--headerHeight); margin-top: 0; margin-bottom: 0; }

/* Buttons */
.btn {
  display: inline-block; padding: 0.75rem 1.5rem; background-color: var(--accent-color); color: white;
  text-decoration: none; border: none; border-radius: 40px;
  font-family: "Newsreader", Helvetica, sans-serif; font-weight: 350; font-size: 1rem; font-style: italic; cursor: pointer; transition: all 0.2s ease;
}
.btn:hover { background-color: #8b7ae8; transform: translateY(-1px); }
.btn--secondary { background-color: transparent; color: var(--accent-color); border: 2px solid var(--accent-color); }
.btn--secondary:hover { background-color: var(--accent-color); color: white; }

@media only screen and (max-width: 768px) {
  .btn { padding: 0.5rem 1rem; font-size: 0.8rem;}
}

/* Hero */
.hero { padding: 13rem 0 18rem 0; text-align: left; }
.hero__maintitle { font-size: 5rem; font-weight: 350; line-height: 1; margin-bottom: 0.1rem; max-width: 700px;   font-family: "Newsreader", Helvetica, sans-serif; font-style: italic;}
.hero__title { font-size: 3rem; font-weight: 350; line-height: 1; margin-bottom: 2rem; max-width: 700px;   font-family: "Newsreader", Helvetica, sans-serif; font-style: italic;}
.hero__mainsubtitle { font-size: 2rem; font-weight: 200; line-height: 1.4; margin-bottom: 3rem; max-width: 800px; color: var(--accent-color);}
.hero__subtitle { font-size: 1.25rem; font-weight: 200; line-height: 1.4; margin-bottom: 3rem; max-width: 600px; }
.hero__subtitle a:hover { text-decoration: underline; }

@media only screen and (max-width: 768px) {
  .hero { padding: 1rem 0 6rem 0; text-align: left; }
  .hero__maintitle { font-size: 2rem; }
  .hero__title { font-size: 1.8rem; }
  .hero__mainsubtitle { font-size: 1.2rem; }
  .hero__subtitle { font-size: 1rem; }
}

/* Section */
.section { margin-bottom: 6rem; }
.section:first-of-type { margin-top: 4rem; }
.section__title { font-size: 1.5rem; font-weight: 350; margin-bottom: 2rem; color: #000;   font-family: "Newsreader", Helvetica, sans-serif; font-style: italic;}
.section__content { font-size: 1.2rem; font-weight: 150; line-height: 1.4; color: #333; }
.section__content ul { list-style: disc; padding-left: 1.2rem; margin-bottom: 1.2rem; }
.section__content li { margin-bottom: 0.6rem; }
.section__link { color: var(--accent-color); }
.section__link:hover { color: #8b7ae8; text-decoration: underline; }
strong, b { font-weight: 400; }

.who-we-are p {
  font-size: 1.2rem;
  font-weight: 150;
  line-height: 1.4;
  color: #333;
  margin-bottom: 1.2272727273rem;
}

.who-we-are__spacer {
  display: block;
}

.whitepaper-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.whitepaper-actions .btn {
  margin: 0;
}

@media only screen and (max-width: 768px) {
  .section__title { font-size: 1.3rem; margin-bottom: 0rem;}
  .section__content {font-size: 1rem; margin-bottom: 0rem;}
  .who-we-are p {font-size: 1rem; }
  .who-we-are__spacer {
    display: none;
  }

  .whitepaper-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Logo grid for endorsement */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}
.logo-intro {
  font-family: "Newsreader", Helvetica, sans-serif;
  font-style: italic;
  font-weight: 350;
  font-size: 1.5rem;
  color: #000;
  text-align: left;
}
.logo-item {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 4px;
  padding: .5rem;
}
.logo-item img {
  max-width: 200px;
  max-height: 80px;
  width: 100%;
  height: auto;
  object-fit: contain;
}
@media only screen and (max-width: 768px) {
  .logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0.75rem;
  }

  .logo-intro {
    grid-column: 1 / -1;
    margin-bottom: -2rem;
    font-size: 1.3rem;
  }

  .logo-item {
    min-height: 0;
  }

  .logo-item img {
    max-width: 100%;
    max-height: none;
    width: 100%;
    height: auto;
  }
}

/* News cards */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 2rem 0; }
.news-card { background-color: #f9f9f9; padding: 1.5rem; border-radius: 4px; border: 1px solid #eee; transition: background-color 0.2s ease; }
.news-card:hover { background-color: var(--accent-color); color: #eee; }
.news-card__title { font-size: 1.1rem; font-weight: 300; margin-bottom: 0.5rem; color: #000; }
.news-card__excerpt { font-size: 0.9rem; color: #666; line-height: 1.4; }
.news-card__title, .news-card__excerpt { transition: color 0.2s ease; }
.news-card:hover .news-card__title, .news-card:hover .news-card__excerpt { color: #fff; }

.news-card--accent {
  background-color: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

.news-card--accent .news-card__title,
.news-card--accent .news-card__excerpt {
  color: #fff;
}

.news-card--accent .news-card__title {
  margin-bottom: 0;
}

.news-card--accent:hover {
  background-color: #8b7ae8;
  border-color: #8b7ae8;
}

.news-card--accent:hover .news-card__title,
.news-card--accent:hover .news-card__excerpt {
  color: #fff;
}
@media only screen and (max-width: 768px) { 
  .news-grid { grid-template-columns: 1fr; }
  .news-card__title { font-size: 1rem; }
}

/* Stay Connected */
.stay-connected { background-color: #f8f9fa; padding: 3rem 0; margin: 4rem 0 0; }
.stay-connected__content { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; align-items: start; }
.stay-connected__title { font-size: 1.5rem; font-weight: 350; margin-bottom: 1rem; color: #000;   font-family: "Newsreader", Helvetica, sans-serif; font-style: italic;}
.stay-connected__description { font-size: 1.2rem; font-weight: 150; line-height: 1.5; color: #333; }
.stay-connected__cta {font-size: 1.2rem; font-weight: 150; line-height: 1.5; color: #333; }
.stay-connected__link { color: var(--accent-color); text-decoration: none; }
.stay-connected__link:hover { color: #8b7ae8; text-decoration: underline; }

@media only screen and (max-width: 768px) {
  .stay-connected__content { grid-template-columns: 1fr; gap: 2rem; }
  .stay-connected__description { font-size: 1rem; }
  .stay-connected__cta { font-size: 1rem; }
  .stay-connected__cta { align-items: flex-start; }
}

/* Layers list (legacy section—kept in case used elsewhere) */
.layers-list { display: flex; flex-direction: column; }
.layer-link { display: block; padding: 1rem 0; border-bottom: 1px solid #eee; color: #000; 
  text-decoration: none; font-size: 1.2rem; font-weight: 150; font-family: "Inter", Helvetica, sans-serif;
  line-height: 1.2; transition: color 0.2s ease; }
.layer-link:hover { color: var(--accent-color); }
.layer-link:last-child { border-bottom: none; }

@media only screen and (max-width: 768px) { .layer-link { font-size: 1rem; } }

/* Footer */
.footer { background-color: var(--accent-color); color: white; padding: 2rem 0; margin-top: 0; }
.footer__content { display: flex; justify-content: space-between; align-items: center; }
.footer__text { font-size: 0.9rem; color: white; }
.footer__links { display: flex; gap: 2rem; }
.footer__links a { color: white; text-decoration: none; font-size: 0.9rem; }
.footer__links a:hover { text-decoration: underline; }
.footer__text a { color: white; }
.footer__text a:hover { text-decoration: underline; }
@media only screen and (max-width: 768px) {
  .footer__content { flex-direction: column; gap: 1rem; text-align: center; }
  .footer__links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* ===== Whitepaper Reader (Bootstrap Scrollspy) ===== */

/* Scroll box fills viewport under the fixed header */
#wp-scrollbox {
  position: relative; /* required by Scrollspy when using a scroll container */
  max-height: calc(100dvh - 7rem); /* adjust if needed */
  overflow-x: hidden; /* prevent horizontal scrolling of the entire paper */
  overflow-y: auto;   /* allow vertical scrolling */
  scroll-behavior: smooth; /* progressive enhancement */
}

/* Ensure headings don't sit under the fixed header */
#wp-scrollbox section {
  scroll-margin-top: calc(var(--headerHeight) + 16px);
  padding-top: 1rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1.25rem;
  max-width: 100%;              /* prevent section from exceeding container */
}
#wp-scrollbox section:last-child { border-bottom: 0; }

/* Prevent all content from causing horizontal overflow */
#wp-scrollbox * {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Exception for table wrappers - they need to scroll */
#wp-scrollbox .table-wrapper,
#wp-scrollbox .table-wrapper * {
  max-width: none;
}

/* wp-note tables should always respect container width and wrap */
#wp-scrollbox .wp-note,
#wp-scrollbox .wp-note * {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Optional: tidy the navbar on mobile */
@media (max-width: 768px) {
  #wp-navbar .navbar-brand { font-size: 0.9rem; }
  #wp-scrollbox :where(p, li, blockquote, figcaption, dd, td) {
    font-size: 0.96rem; /* 0.96 × 20px root = 19.2px */
  }
}

/* Accent for Bootstrap active/hover states so it matches your theme */
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active,
.nav-pills .nav-link.active,
.navbar .nav-link.active {
  background-color: var(--accent-color);
  color: #fff;
}
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item:hover {
  background-color: rgba(164,145,252,0.12);
  color: #000;
}

/* Unify box model across the whole site to match Bootstrap page(s) */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* Site-scoped buttons override Bootstrap without renaming */
.tas-scope .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 40px;
    font-family: "Newsreader", Helvetica, sans-serif; 
    font-style: italic;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .tas-scope .btn:hover {
    background-color: #8b7ae8;
    transform: translateY(-1px);
  }
  
  .tas-scope .btn:focus,
  .tas-scope .btn:active,
  .tas-scope .btn.show {
    background-color: var(--accent-color);
    color: #fff;
    border-color: transparent;
    box-shadow: none;
  }
  
  /* Secondary variant */
  .tas-scope .btn--secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
  }
  
  .tas-scope .btn--secondary:hover {
    background-color: var(--accent-color);
    color: #fff;
  }
  
  .tas-scope .btn--secondary:focus,
  .tas-scope .btn--secondary:active,
  .tas-scope .btn--secondary.show {
    background-color: transparent;
    color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: none;
  }

  .tas-scope #wp-navbar .nav-link.dropdown-toggle {
    border-radius: 40px;
    font-family: "Newsreader", Helvetica, sans-serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1rem;
  }

/* Whitepaper chapter dropdown items thinner */
.tas-scope #wp-navbar .dropdown-menu .dropdown-item {
    font-weight: 200;
  }

@media (max-width: 768px) {
  .tas-scope #wp-navbar .dropdown-menu {
    width: calc(100vw - 3rem);
  }

  .tas-scope #wp-navbar .dropdown-menu .dropdown-item {
    white-space: normal;
  }
}
  
/* Whitepaper reader headings */
.tas-scope #wp-scrollbox h1 {
  font-weight: 350;
  font-size: 1.5rem;
  color: var(--accent-color);
  font-family: "Newsreader", Helvetica, sans-serif;
  font-style: italic;
}

.tas-scope #wp-scrollbox h2 {
  font-size: 1.3rem;
  font-weight: 300;
  margin-top: 3rem;
}

.tas-scope #wp-scrollbox h3 {
  font-style: italic;
  font-size: 1.1rem;
  margin-top: 2rem;
}

/* ===== Whitepaper content tweaks (minimal) ===== */

/* Restore readable links only inside reader */
.tas-scope #wp-scrollbox a {
  text-decoration: underline;
}

/* Comfortable paragraph rhythm */
.tas-scope #wp-scrollbox p {
  line-height: 1.65;
}

/* Lists (your global reset removes bullets) */
.tas-scope #wp-scrollbox ul,
.tas-scope #wp-scrollbox ol {
  margin: 0.75rem 0 1rem 1.25rem;
}
.tas-scope #wp-scrollbox ul { list-style: disc; }
.tas-scope #wp-scrollbox ol { list-style: decimal; }
.tas-scope #wp-scrollbox li { margin: 0.35rem 0; }
.tas-scope #wp-scrollbox ul ul { list-style: circle; margin-top: 0.25rem; }
.tas-scope #wp-scrollbox ol ol { list-style: lower-alpha; margin-top: 0.25rem; }

/* Blockquotes */
.tas-scope #wp-scrollbox blockquote {
  border-left: 4px solid var(--accent-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: #faf9ff;
  color: #333;
  font-style: italic;
}

/* Inline code */
.tas-scope #wp-scrollbox code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  background: #f4f4f8;
  border: 1px solid #e8e8ef;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Table wrapper for horizontal scrolling */
.tas-scope #wp-scrollbox .table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 2rem 0;
}

/* Slightly larger H1 in reader for hierarchy */
.tas-scope #wp-scrollbox h1 { font-size: 1.5rem; }

.tas-scope #wp-scrollbox .wp-note {
  width: 100%;
  max-width: 100%;              /* prevent exceeding container */
  border: 1px solid var(--accent-color);   /* outer border uses accent */
  border-radius: 8px;
  margin: 1rem 0 1.5rem;
  table-layout: fixed;          /* fixed layout ensures text wraps */
  border-collapse: separate;    /* needed for border-radius */
  border-spacing: 0;
}

.tas-scope #wp-scrollbox .wp-note td {
  padding: 0.75rem 1rem;
  word-wrap: break-word;        /* wrap long words */
  overflow-wrap: break-word;    /* modern wrapping */
  hyphens: auto;                /* hyphenate if needed */
  line-height: 1.65;            /* comfortable line height */
}

/* TL;DR row background */
.tas-scope #wp-scrollbox .wp-note tr:first-child td {
  background: #d9d0ff;
  color: #222;
  border-radius: 8px;
}

.tas-scope #wp-scrollbox .wp-table {
  width: 100%;
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  overflow: hidden;               /* lets the radius clip the header bg */
  background: #fff;
  border-collapse: separate;
  border-spacing: 0;              /* no gaps between cells */
  table-layout: auto;             /* allow columns to size based on content */
  min-width: max-content;         /* table grows to fit content */
}

.tas-scope #wp-scrollbox .wp-table th,
.tas-scope #wp-scrollbox .wp-table td {
  padding: 0.75rem 1rem;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;            /* align content to top for multi-line cells */
  overflow-wrap: anywhere;        /* wrap long words */
  word-break: break-word;         /* break words if needed */
  hyphens: auto;                  /* hyphenate long words */
  border-bottom: 1px solid #e9e6ff; /* subtle inner divider */
  max-width: 300px;               /* maximum column width to encourage wrapping */
  min-width: 80px;                /* minimum column width for very narrow screens */
}

.tas-scope #wp-scrollbox .wp-table thead th {
  background: #d9d0ff;           /* same lilac as TL;DR */
  color: #222;
  border-bottom: 1px solid var(--accent-color);
  white-space: normal;           /* allow header text to wrap */
  overflow-wrap: anywhere;       /* modern */
  word-break: break-word;        /* fallback for older browsers */
  hyphens: auto;     
  font-weight: 350;            /* optional, nicer breaks */
}

.tas-scope #wp-scrollbox .wp-table tbody tr:last-child td {
  border-bottom: 0;               /* no divider after last row */
}

@media (max-width: 768px) {
  .tas-scope .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  /* On mobile, reduce max column width to encourage more wrapping */
  .tas-scope #wp-scrollbox .wp-table th,
  .tas-scope #wp-scrollbox .wp-table td {
    max-width: 200px;           /* smaller max width for mobile */
    min-width: 60px;            /* smaller min width for mobile */
  }
}